using aichat.Entities;
using Microsoft.EntityFrameworkCore;
using System.IO;

namespace aichat.Data
{
    public class ApplicationDbContext : DbContext
    {


        private string strDb = $"Data Source = {Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SqliteDemo\\sqlite.db")}";
        public ApplicationDbContext() : base()
        {
        }

        public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options)
        {
        }

        public DbSet<UserModel> Users { get; set; }
        public DbSet<ChatMessage> ChatMessages { get; set; }
        public DbSet<AiModel> AiModels { get; set; }
        public DbSet<PaymentRecord> PaymentRecords { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            if (!string.IsNullOrWhiteSpace(strDb))
            {
                optionsBuilder.UseSqlite(strDb);
                
             
            }
        }

     
    }
} 